package club.justwill.single.bean;

import club.justwill.single.persistence.jpo.OrderItem;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Created by jaylon on 15-12-26.
 */
public class OrderItemBean {


    @JsonProperty("skuId")
    private long skuId ;

    @JsonProperty("units")
    private Integer units ;

    public OrderItemBean() {}

    public OrderItemBean(OrderItem orderItem) {
        this.setSkuId(orderItem.getSkuId());
        this.setUnits(orderItem.getUnits());
    }

    public long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        if(skuId == null)
            this.skuId =0;
        this.skuId = skuId;
    }

    public int getUnits() {
        return units;
    }

    public void setUnits(Integer units) {
        if(units == null)
            this.units = 0;
        else
           this.units = units;
    }


}
